/**
  ******************************************************************************
  * @file    Project/STM32F10x_StdPeriph_Template/stm32f10x_it.h
  * @author  MCD Application Team
  * @version V3.5.0
  * @date    08-April-2011
  * @brief   This file contains the headers of the interrupt handlers.
  ******************************************************************************
  * @attention
  *
  * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
  * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
  * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
  * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
  * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
  * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
  *
  * <h2><center>&copy; COPYRIGHT 2011 STMicroelectronics</center></h2>
  ******************************************************************************
  */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef _APP_ERROR_H_
#define _APP_ERROR_H_

#include <stdint.h>
#include "stm32h7xx_hal.h"

typedef enum{
	HARD_FAULT_ERR = 0,
	MEMMANAGER_ERROR,
	BUSFAULT_ERR,
	USAGEFAULT_ERR,
	NWI_ERROR,
	ASSERT_ERROR,
	FLASH_ERROR,
	LOG_ERROR,
	MSGPOOL_ERROR,
	SYSEM_UPDATE,
	SERVER_RESET,
	REBOOT_COMM_ERROR
}err_type_t;


typedef struct app_error{
	uint16_t   err_type;           //出错类型
	uint16_t   res;
	uint32_t   register_r0;
	uint32_t   register_r1;
	uint32_t   register_r2;
	uint32_t   register_r3;
	uint32_t   register_r12;
	uint32_t   register_lr;
	uint32_t   register_pc;
	uint32_t   register_psr;
	uint32_t   register_bfar;
	uint32_t   register_cfsr;
	uint32_t   register_hfsr;
	uint32_t   register_dfsr;
	uint32_t   register_afsr;
}app_err_t;



/******************************************************************************
 * @brief error_fault_handler 由系统异常调用，记录堆栈信息
 *****************************************************************************/
void error_fault_handler(volatile uint32_t * hardfault_args,uint32_t err);


void SoftReset(void);
#endif

/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
